function testMemory() {
    let memory = process.memoryUsage().heapUsed;
    console.log(memory / 1024 / 1024 + "mb");
}

let size = 30 * 1024 * 1024;
let arr1 = new Array(size);
testMemory();
// IFFE 函数执行完后 系统发现内存不足 然后寻找可回收变量
// 局部变量在失去引用后可被回收
(function() {
    let arr2 = new Array(size);
    testMemory();
    let arr3 = new Array(size);
    testMemory();
})();
let arr4 = new Array(size);
testMemory();
let arr5 = new Array(size);
testMemory();
let arr6 = new Array(size);